package com.zly.entity.parameter;

import com.zly.FunctionManager;

import java.lang.reflect.Method;

public class FunctionReturnValueParameter extends DynamicJsonParameter {

    private String functionName;
    private final Object[] functionArgs;

    private Method method;
    private boolean isOriginalStringType;

    //构造
    public FunctionReturnValueParameter(String parameterName, String functionName, Object[] functionArgs) {

        super(parameterName);
        this.functionName = functionName;
        this.functionArgs = functionArgs;

        method = null;

    }

    public void matchMethod(FunctionManager functionManager) {
        this.method = functionManager.bestMatch(this);
    }

    //getter,setter
    public void setFunctionName(String functionName) { this.functionName = functionName; }
    public String getFunctionName() {
        return functionName;
    }
    public Object[] getFunctionArgs() {
        return functionArgs;
    }
    public Method getMethod() { return method; }

    public void setIsOriginalStringType(boolean isOriginalStringType) {
        this.isOriginalStringType = isOriginalStringType;
    }

    @Override
    public boolean isOriginalStringType() {
        return isOriginalStringType;
    }

}
